<!DOCTYPE html>
<html>
<head>
	<title>新闻</title>
	<link href="/libs/css/bootstrap.min.css" rel="stylesheet">
	<link href="/libs/css/sweetalert.min.css" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="/css/public.css">
	<script src="/libs/js/jquery.min.js"></script>
	<script src="/libs/js/bootstrap.min.js"></script>
	<script src="/libs/js/vue.min.js"></script>
	<script src="/libs/js/sweetalert.min.js"></script>
	<style type="text/css">
		[v-cloak] {
		display: none;
		} 
	</style>
</head>
<body>
<div id="app" v-cloak style="padding-bottom: 200px;">

	<nav class="navbar navbar-default" role="navigation">
		<div class="container-fluid">
		<div class="navbar-header">
			<a class="navbar-brand" href="/">新闻网</a>
		</div>
		<div>
			<ul class="nav navbar-nav" style="float:right;">
				<li v-if="userMsg.isLogin == false"><a style="cursor: pointer;" :href="'/register.html?jump='+window.location.pathname+window.location.search">注册</a></li>
				<li v-if="userMsg.isLogin == false"><a style="cursor: pointer;" :href="'/login.html?jump='+window.location.pathname+window.location.search">登录</a></li>
				<li v-if="userMsg.isLogin == true" class="dropdown">
					<a href="#" class="dropdown-toggle" data-toggle="dropdown">
						{{userMsg.name||userMsg.account}}
						<b class="caret"></b>
					</a>
					<ul class="dropdown-menu" style="left:auto;right:0;min-width:100px">
						<li style="height:40px;"><a href="/message.html" style="line-height: 40px">个人信息</a></li>
						<li v-on:click="logout" style="height:40px;"><a href="#" style="line-height: 40px">退出登录</a></li>
					</ul>
				</li>
			</ul>
		</div>
		</div>
	</nav>

	<div class="subnav">
		<li v-for="module in moduleList"><a :href="'/classify.html?module='+module.id">{{module.name}}</a></li>
	</div>

	<div class="news-container">
		<h2 style="line-height: 50px;">{{news.title}}</h2>
		<p style="margin: 20px 0px;"><label>分类：{{news.module_name}}</label><span style="float:right">发表时间：{{new Date(news.createtime).toLocaleString()}}</span></p>
		<div style="width: 660px;margin: 0 auto">
			<div>
				<img style="margin: 0 auto" class="img-responsive" :src="news.coverimg">
			</div>
			<div v-html="news.content" style="font-size: 16px;line-height: 2;">
			</div>
		</div>
		<div class="news-comment">
			<form role="form">
				<div class="form-group">
					<label for="name">有感而发</label>
					<textarea style="resize:none;" placeholder="写下你的评论,200字以内" class="form-control" rows="3" maxlength="200" v-model="textarea"></textarea>
				</div>
			</form>
			<div style="text-align: right;">
				<button type="button" class="btn btn-success" :disabled="textarea==''" v-on:click="post">提交</button>
			</div>
			<div class="news-comment-list">
				<div v-for="item in comments" class="item">
					<div class="item-img">
						<img class="img-responsive" :src="item.headimg || '/assets/head.jpg'">
					</div>
					<div class="item-msg">
						<p>用户：{{item.name || item.account}}
							<span style="margin-left: 50px;"> 发表时间：{{new Date(item.createtime).toLocaleString()}}</span>
						</p>
						<p>{{item.content}}</p>
					</div>
				</div>
			</div>
		</div>
	</div>



</div>



<script type="text/javascript" src="/js/news.js"></script>
</body>
</html>